<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>将 PKCS#12 兼容证书存储文件导出到变量</title>
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-base.css" />
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-medium.css" />

 </head>
 <body class="docs"><div class="navbar navbar-fixed-top">
  <div class="navbar-inner clearfix">
    <ul class="nav" style="width: 100%">
      <li style="float: left;"><a href="function.openssl-pkcs12-export-to-file.html">« openssl_pkcs12_export_to_file</a></li>
      <li style="float: right;"><a href="function.openssl-pkcs12-read.html">openssl_pkcs12_read »</a></li>
    </ul>
  </div>
</div>
<div id="breadcrumbs" class="clearfix">
  <ul class="breadcrumbs-container">
    <li><a href="index.html">PHP Manual</a></li>
    <li><a href="ref.openssl.html">OpenSSL 函数</a></li>
    <li>将 PKCS#12 兼容证书存储文件导出到变量</li>
  </ul>
</div>
<div id="layout">
  <div id="layout-content"><div id="function.openssl-pkcs12-export" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">openssl_pkcs12_export</h1>
  <p class="verinfo">(PHP 5 &gt;= 5.2.2, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">openssl_pkcs12_export</span> &mdash; <span class="dc-title">将 PKCS#12 兼容证书存储文件导出到变量</span></p>

 </div>
 
 <div class="refsect1 description" id="refsect1-function.openssl-pkcs12-export-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>openssl_pkcs12_export</strong></span>(<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type"><a href="language.types.declarations.html#language.types.declarations.mixed" class="type mixed">mixed</a></span> <code class="parameter">$x509</code></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type">string</span> <code class="parameter reference">&$out</code></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type"><a href="language.types.declarations.html#language.types.declarations.mixed" class="type mixed">mixed</a></span> <code class="parameter">$priv_key</code></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type">string</span> <code class="parameter">$pass</code></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type">array</span> <code class="parameter">$args</code><span class="initializer"> = ?</span></span><br>): <span class="type">bool</span></div>

  <p class="para rdfs-comment">
   <span class="function"><strong>openssl_pkcs12_export()</strong></span> 以 PKCS#12 文件格式 将 <code class="parameter">x509</code> 导入到以<code class="parameter">out</code>命名类型为字符串的变量中。
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.openssl-pkcs12-export-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>
    
<dt>
<code class="parameter">x509</code></dt>

<dd>

 <p class="para">
  参见<a href="openssl.certparams.html" class="link">密钥／证书参数</a>以获取有效值列表。
 </p>
</dd>


    
     <dt>
<code class="parameter">out</code></dt>

     <dd>

      <p class="para">
       成功，该字符串将为 PKCS#12 格式。
      </p>
     </dd>

    
    
     <dt>
<code class="parameter">priv_key</code></dt>

     <dd>

      <p class="para">
       PKCS#12 文件的私钥部分file，
       参见 <a href="openssl.certparams.html" class="link">公/私钥参数</a> 获取更多可用列表。
      </p>
     </dd>

    
    
     <dt>
<code class="parameter">pass</code></dt>

     <dd>

      <p class="para">
      用来解锁 PKCS#12 文件的解密密码。
      </p>
     </dd>

    
    
     <dt>
<code class="parameter">args</code></dt>

     <dd>

      <p class="para">
       可选数组，其他主键将被忽略。
       <table class="doctable informaltable">
        
         <thead>
          <tr>
           <th>Key</th>
           <th>说明</th>
          </tr>

         </thead>

         <tbody class="tbody">
          <tr>
           <td><code class="literal">&quot;extracerts&quot;</code></td>
           <td>PKCS#12 文件中包含的额外证书或单个证书的数组。</td>
          </tr>

          <tr>
           <td><code class="literal">&quot;friendlyname&quot;</code></td>
           <td>被证书和密钥使用的字符串</td>
          </tr>

         </tbody>
        
       </table>

      </p>
     </dd>

    
   </dl>

  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.openssl-pkcs12-export-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   成功时返回 <strong><code>true</code></strong>， 或者在失败时返回 <strong><code>false</code></strong>。
  </p>
 </div>


</div></div></div></body></html>